import request from '@/utils/request'
export function fetchList(params) {
  return request({
    url: '/crm/integralRule/list',
    method: 'get',
    params: params
  })
}

export function getReasonDetail(id) {
  return request({
    url: '/crm/integralRule/getById/?id=' + id,
    method: 'get'
  })
}
export function Memberstatistics(merchantId) {
  return request({
    url: '/crm/integralRule/integralCount?merchantId=' + merchantId,
    method: 'get',
    merchantId: merchantId
  })
}
export function getById(id) {
  return request({
    url: '/crm/integralRule/getById' + id,
    method: 'get',
  })
}
export function deleteCoupon(params) {
  return request({
    url: '/crm/integralRule/setStatus',
    method: 'post',
    params: params
  })
}
// export function addReason(data) {
//   return request({
//     url: '/crm/integralRule/update',
//     method: 'post',
//     data: data
//   })
// }

export function updateReason(params) {
  return request({
    url: '/crm/integralRule/update/',
    method: 'post',
    params: params
  })
}
export function update(id, data) {
  return request({
    url: '/crm/integralRule/update' + id,
    method: 'post',
    data: data
  })
}

export function setStatus(params) {
  return request({
    url: 'crm/integralRule/setStatus',
    method: 'post',
    params: params
  })
}
